<template>
  <!-- 审批页面，查看业务详情 -->
  <div
    v-show="curComponent"
    class="AuditBusinessDetail-container"
    :class="[isConsultation ? 'consultation-class' : 'audit-class']"
  >
    <!-- 意见征询不显示标题 -->
    <h1 v-if="!isConsultation">{{ title }}</h1>
    <component
      :is="curComponent"
      v-bind="props"
      :is-audit="true"
      :is-consultation="isConsultation"
      :other-data="otherData"
    />
  </div>
</template>

<script>
import { findListByMainMaterialId } from '@/api/material/settlement/settlement'
import { whoIsContract } from '@/api/legal'
import { getAllBusinessCode } from '@/api/complaint'
import { asyncRouterMap, constantRouterMap } from '@/config/router.config'
import { findContractMenuById } from '@/api/material/contract/parameter'
import { getPlanHighlights } from '@/api/technical/planHighlights'

export default {
  name: 'AuditBusinessDetail',
  components: {
    postReportingDetailed: () => import('@/views/businessAffairs/postReporting/detailed'),
    workMasterPlanAed: () => import('@/views/businessAffairs/workPlan/workMasterPlan/workMasterPlanAed'),
    throwMarkDetailed: () => import('@/views/businessAffairs/throwMark/detailed'),
    addPlannedOutputValue: () => import('@/views/project/productionRecords/addPlannedOutputValue'),
    businessPlan: () => import('@/views/businessAffairs/businessOrganization/businessPlan/edit'),
    designPlanning: () => import('@/views/businessAffairs/businessOrganization/designPlanning/edit'),
    costPlanning: () => import('@/views/businessAffairs/businessOrganization/costPlanning/edit'),
    //项目策划任务表
    projectManagementPlanning: () => import('@/views/matters/approval/components/projectManagementPlanning'),
    // 工程策划表
    plannTableSummaryView: () => import('@/views/project/plannManagement/plannTableSummary/plannTableSummaryView'),
    // 客服
    complaintAdd: () => import('@/views/complaint/Management/list/add'),
    // 维保
    standingAdd: () => import('@/views/complaint/Maintenance/standing/add'),
    // 物资需求总计划
    materialMasterPlanAdd: () => import('@/views/materials/materialMasterPlan/add'),
    // 项目动态信息
    projectDynamicInformationDetail: () => import('@/views/project/projectDynamicInformation/projectManager'),
    // 项目经理月报详情
    projectManagerMonthlyReportView: () => import('@/views/project/projectManagerMonthlyReport/projectManagerMonthlyReportView.vue'),
    // 物资设备采购策划
    equipmentPurchasePlanAdd: () => import('@/views/materials/equipmentPurchasePlan/add'),
    // 物资需求月计划
    materialMonthPlan: () => import('@/views/materials/materialMonthPlan/add'),
    // 工程物资需求月计划
    suppliesMonthPlan: () => import('@/views/project/suppliesManagement/suppliesMonthPlan/add'),
    // 合同计划
    contractorView: () => import('@/views/construction/contractor/contractorView'),
    // 物资招标计划
    procurementPlanAdd: () => import('@/views/materials/procurement/plan/add'),
    // 物资招标采购申请
    procurementApplyAdd: () => import('@/views/materials/procurement/apply/add'),
    // 物资招标文件评审
    procurementReviewAdd: () => import('@/views/materials/procurement/review/add'),
    // 物资招标评审会签
    procurementSignAdd: () => import('@/views/materials/procurement/sign/add'),
    // 物资招标评审会签
    inventoryCheckAdd: () => import('@/views/materials/inventory/check/add'),
    // 物资盘点记录详情
    contractReviewAdd: () => import('@/views/materials/contract/review/add'),
    // 物资合同台账
    contractParameterDetail: () => import('@/views/materials/contract/parameter/detail'),
    // 合同交底记录
    contractClarificaitonAdd: () => import('@/views/materials/contract/clarificaiton/add'),
    // 机械设备进场验收
    acceptanceDeviceAdd: () => import('@/views/materials/acceptance/device/add'),
    // 物资用量确认单
    acceptanceDosageAdd: () => import('@/views/materials/acceptance/dosage/add'),
    // 供应商考察
    supplierInspectionAdd: () => import('@/views/materials/supplier/inspection/add'),
    // 采购效益率
    benefitAnalysisAdd: () => import('@/views/materials/benefitAnalysis/benefitAnalysis/add'),
    //分公司工程履约管理
    updateBranchPerformanceAnalysis: () => import('@/views/project/performanceAnalysis/branchPerformanceAnalysis/updateBranchPerformanceAnalysis'),
    // 总包结算目标责任书审批详情
    projectSettlementAdd: () => import('@/views/businessAffairs/revenueAndCost/projectSettlement/projectSettlementAdd'),
    // 总包结算策划详情
    projectTotalAdd: () => import('@/views/businessAffairs/revenueAndCost/projectTotal/projectTotalAdd'),
    // 总包结算报送审批详情
    projectTotalApprovalAdd: () => import('@/views/businessAffairs/revenueAndCost/projectTotalApproval/projectTotalApprovalAdd'),
    // 分包施工图预算审批详情
    subcontractingBudget: () => import('@/views/businessAffairs/constructionBudget/subcontractingBudget/newIncrease'),
    // 总包施工图预算审批详情
    lumpSumBudget: () => import('@/views/businessAffairs/constructionBudget/lumpSumBudget/newIncrease'),
    //项目商务策划书
    planBook: () => import('@/views/businessAffairs/planBook/newIncrease'),
    //分包计量审批
    smlDetail: () => import('@/views/businessAffairs/subcontractMeasurement/sml/smDetail'),
    //分包预算转总价审批
    updateTotalPriceApproval: () => import('@/views/businessAffairs/subcontractMeasurement/totalPriceApproval/updateTotalPriceApproval'),

    //个人预留风险金返还申请
    updatePersonalRiskRefund: () => import('@/views/businessAffairs/riskRefund/personalRiskRefund/updatePersonalRiskRefund'),
    //个人预留风险金抵转申请
    updatePersonalRiskToTurn: () => import('@/views/businessAffairs/riskRefund/personalRiskToTurn/updatePersonalRiskToTurn'),
    //项目风险金返还
    updateProjectRiskRefund: () => import('@/views/businessAffairs/riskRefund/projectRiskRefund/updateProjectRiskRefund'),
    //总收入总成本录入
    updateRevenueCostInput: () => import('@/views/businessAffairs/expectRevenueAndCost/revenueCostInput/updateRevenueCostInput'),
    // 总收入总成本调整
    updateAdjustIncomeCost: () => import('@/views/businessAffairs/expectRevenueAndCost/adjustIncomeCost/updateAdjustIncomeCost'),
    // 项目成本还原、总结
    updateCostReduction: () => import('@/views/businessAffairs/revenueAndCost/costReduction/updateCostReduction'),
    // 标价分离书
    updatePriceSeparation: () => import('@/views/businessAffairs/throwMark/priceSeparation/updatePriceSeparation'),
    //  成本分析表
    updateCostAnalysisAudit: () => import('@/views/businessAffairs/revenueAndCost/costAnalysisAudit/updateCostAnalysisAudit'),
    //  分包人成本指导价
    updateSubcontractCostPrice: () => import('@/views/businessAffairs/subcontractPrice/subcontractCostPrice/updateSubcontractCostPrice'),
    //  总包签证报送审批
    updateVisaApproval: () => import('@/views/businessAffairs/lumpSumMeasurement/visaApproval/updateVisaApproval'),
    //  总包结算定案审批
    finalApproval: () => import('@/views/businessAffairs/finalApproval/edit'),
    //  期中结算报送审批
    updateSettlementSubmit: () => import('@/views/businessAffairs/revenueAndCost/settlementSubmit/updateSettlementSubmit'),
    //  期中结算定案审批
    updateSettlementFinalized: () => import('@/views/businessAffairs/revenueAndCost/settlementFinalized/updateSettlementFinalized'),
    //  设计变更管理
    updateDesignChange: () => import('@/views/businessAffairs/lumpSumMeasurement/designChange/updateDesignChange'),
    //  总包确认归档
    updateVisaConfirm: () => import('@/views/businessAffairs/lumpSumMeasurement/visaConfirm/updateVisaConfirm'),
    //  目标责任书
    updateTargetBook: () => import('@/views/businessAffairs/responsibilityManagement/targetBook/updateTargetBook'),
    //  业主确权及实际产值
    updateRealProduct: () => import('@/views/businessAffairs/lumpSumMeasurement/realProduct/updateRealProduct'),
    //  竣工台账
    standingBook: () => import('@/views/technical/standingBook/detailed'),

    //  设计图纸管理
    updateDrawingManagement: () => import('@/views/technical/designFM/drawingManagement/updateDrawingManagement'),
    //设计变更
    updatedesignChanges: () => import('@/views/technical/designFM/designChanges/updatedesignChanges'),
    //设计月报
    updateWorkReport: () => import('@/views/design/monthlyReport/monthlyWorkReport/updateWorkReport'),
    //设计月报详情
    monthlyReport: () => import('@/views/design/monthlyReport/edit'),
    //设计变更会审/洽商
    updateDrawingAndNegotiation: () => import('@/views/technical/designFM/drawingAndNegotiation/updateDrawingAndNegotiation'),
    //  技术复核管理-月度
    updateMonthlyPlan: () => import('@/views/technical/technicalReview/monthlyPlan/updateMonthlyPlan'),
    //  技术复核管理-年度
    updateYearlyPlan: () => import('@/views/technical/technicalReview/yearlyPlan/updateYearlyPlan'),
    //技术服务需求详情
    updateServiceDemand: () => import('@/views/technical/expert/serviceDemand/updateServiceDemand'),
    //  施工组织设计(方案)审批计划
    newPlan: () => import('@/views/technical/ShiGroup/newPlan'),
    //  经典方案集锦
    updatePlanHighlights: () => import('@/views/technical/ShiGroup/planHighlights/programCollection/updatePlanHighlights'),
    //  公司基础规范
    updateBaseStandard: () => import('@/views/technical/specificationList/baseStandard/updateBaseStandard'),
    //  项目规范
    updateProjectStandard: () => import('@/views/technical/specificationList/projectStandard/updateProjectStandard'),
    //  施工组织方案审批
    Approval: () => import('@/views/technical/ShiGroup/Approval/EditFrom'),

    //  危险作业
    addHazardousOperation: () => import('@/views/safetySupervision/hazardousOperation/hazardousOperationList/addHazardousOperation'),

    //  双优化立项业务流程
    optimizationPlan: () => import('@/views/technical/optimizationPlan/detailed'),

    //  钢筋精益化管理
    steelTendon: () => import('@/views/technical/steelTendon/detailed'),

    //  危大工程
    UpdateProjectControl: () => import('@/views/safetySupervision/dangerProjectControl/projectControlPlan/UpdateProjectControl'),

    //  安全管理制度发布
    UpdateSystem: () => import('@/views/safetySupervision/safetySystem/systemManage/UpdateSystem'),

    //  安全责任指标考核记录
    UpdateRecord: () => import('@/views/safetySupervision/examRecord/recordList/UpdateRecord'),

    //  个人工作项维护
    UpdateWorkItem: () => import('@/views/safetySupervision/examRecord/personalWorkItem/UpdateWorkItem'),

    //  危险源辨识
    inMeeting: () => import('@/views/safetySupervision/hazardIdentification/hazardIdentificationList/addConference'),

    //资产处置申请
    assetsDisposalAdd: () => import('@/views/materials/assets/disposal/add'),

    // 剩余物资处置申请
    remainingDisposalAdd: () => import('@/views/materials/remaining/disposal/add'),

    // 剩余物资结算单
    remainingSettlementAdd: () => import('@/views/materials/remaining/settlement/add'),

    // 剩余物资调拨单
    remainingTransfersAdd: () => import('@/views/materials/remaining/transfers/add'),

    // 资产调拨单
    assetsTransfersAdd: () => import('@/views/materials/assets/transfers/add'),

    // 结算管理
    //混凝土结算
    settlementConcreteAdd: () => import('@/views/materials/settlement/concrete/add'),
    //租赁费结算单
    settlementLeaseAdd: () => import('@/views/materials/settlement/lease/add'),
    //物资结算
    settlementMaterialsAdd: () => import('@/views/materials/settlement/materials/add'),
    //整改回复
    checkRectificationAdd: () => import('@/views/materials/check/rectification/add'),

    //分包招议标计划详情
    planDiscussionDetails: () => import('@/views/Legal/branchBidding/planDiscussion/details'),

    //分包招议标计划完成情况详情
    planCompleteDetails: () => import('@/views/Legal/branchBidding/planComplete/details'),

    //执行案件详情信息
    caseManagementCaseDetails: () => import('@/views/Legal/caseLawyerLetter/caseManagement/caseDetails'),

    // 律师函管理详情
    lawyerLetterDetails: () => import('@/views/Legal/caseLawyerLetter/lawyerLetter/lawyerLetterDetails'),

    // 索赔立项详情
    claimEstablishmentDetails: () => import('@/views/Legal/caseLawyerLetter/claimEstablishment/claimEstablishmentDetails'),

    // 分包合同信息
    branchContractDetails: () => import('@/views/Legal/branchContract/management/editOrdinaryContract.vue'),

    //总包合同信息
    totalPackageContractDetails: () => import('@/views/Legal/branchContract/totalPackageContract/auditDetail'),
    //其他合同信息
    otherTypeContractDetails: () => import('@/views/Legal/branchContract/otherTypesContract/detail'),

    //风险管理信息详情
    riskListDetail: () => import('@/views/Legal/risk/list/detail'),

    // 项目立项详情
    createProjectDetail: () => import('@/views/project/projects/addProjects/details'),
    // 施工进度月计划详情
    planDetailMonth: () => import('@/views/construction/constructionSchedule/planDetails'),
    // 施工进度周计划详情
    planDetailWeek: () => import('@/views/construction/constructionSchedule/planDetails'),
    // 施工进度总计划详情
    constructionScheduleView: () => import('@/views/construction/constructionSchedule/constructionScheduleView'),
    // 节点开始详情
    NodeStartPage: () => import('@/views/construction/constructionSchedule/components/NodeStartPage'),
    // 节点完成详情
    NodeMaintainPage: () => import('@/views/construction/constructionSchedule/components/NodeMaintainPage'),
    // 竣工收尾计划详情
    constructionCompletedView: () => import('@/views/construction/constructionCompleted/constructionCompletedView'),
    // 竣工收尾计划节点维护详情
    constructionCompletedNodeMaintainPage: () => import('@/views/construction/constructionSchedule/components/NodeMaintainPage'),
    // 施工进度总计划调整
    constructionScheduleAdjustView: () => import('@/views/construction/constructionScheduleAdjust/constructionScheduleAdjustView'),
    // 月计划审批详情
    constructionMonthPlanView: () => import('@/views/construction/monthPlan/monthPlanView'),
    // 月计划节点维护审批
    constructionMonthPlanNodeMaintainPage: () => import('@/views/construction/monthPlan/components/NodeMaintainPage'),
    // 月计划调整审批详情
    monthPlanAdjustView: () => import('@/views/construction/monthPlanAdjust/monthPlanAdjustView'),
    // 督办详情
    superviseDetail: () => import('@/views/office/supervise/detail'),

    //工会组织架构审批详情
    updateOrganizationalStructure: () => import('@/views/union/organizationManagement/organizationalStructure/updateOrganizationalStructure'),

    // 困难详情
    difficultiesEmployeesApplyDetail: () => import('@/views/union/employeeCare/difficultiesEmployeesApply/add'),

    // 监督员上报详情
    supervisorReportDetail: () => import('@/views/disciplineInspection/orgStructure/supervisorReport/UpdateSupervisorReport.vue'),

    // 监督月报详情
    updateProjectSupervision: () => import('@/views/disciplineInspection/supervision/projectSupervision/updateProjectSupervision.vue'),

    // 临时用餐申请
    updateApplyEat: () => import('@/views/office/canteen/applyEat/updateApplyEat.vue'),
    // 延期归档申请详情
    delayArchiveApplyDetail: () => import('@/views/office/archiveManage/archiveApply/UpdateArchiveApply.vue'),
    // 竣工项目归档详情
    ArchiveDocDetail: () => import('@/views/office/archiveManage/archiveDoc/UpdateArchiveDoc.vue'),

    // 档案借阅详情
    archivesBorrowingDetail: () => import('@/views/office/archivesBorrowing/archivesBorrowingEdit'),
    // 职工合理化建议详情
    staffRationalizationSuggestionsDetail: () => import('@/views/union/democracy/staffRationalizationSuggestions/staffRationalizationSuggestionsEdit'),
    // 企务公开详情
    corporateAffairsOpenDetail: () => import('@/views/union/democracy/corporateAffairsOpen/corporateAffairsOpenEdit'),
    // 职工维权上报详情
    workerProtectionDetail: () => import('@/views/union/workerProtection/report/reportEdit'),
    // 文化建设活动详情
    integrityCultureConstructionDetail: () => import('@/views/disciplineInspection/integrityCultureConstruction/detail'),
    // 资产调拨详情
    assetManagementTransferAdd: () => import('@/views/office/assetManagement/transfer/add'),
    // 党群活动详情
    partyActivityDetail: () => import('@/views/partyMasses/partyManage/partyActivity/UpdatePartyActivity.vue'),
    //党员对内转出流程详情
    partyMemberChangeDtl: () => import('@/views/partyMasses/partyMember/changeDtl'),
    //团员对内转出流程详情
    leagueManageChangeDtl: () => import('@/views/partyMasses/leagueManage/member/changeDtl'),
    // 函件反馈
    letterFeedbackDetail: () => import('@/views/Legal/caseLawyerLetter/lawyerLetter/updateLawyerLetter.vue'),
    // 执行案件反馈
    caseFeedbackDetail: () => import('@/views/Legal/caseLawyerLetter/caseManagement/UpdateCase.vue'),
    // 设计培训管理会
    trainingConferenceDetail: () => import('@/views/design/training/trainingConference/components/OperationConference.vue'),
    // 深化设计策划书管理
    planningManagementDetail: () => import('@/views/design/deepDesign/planningManagement/form.vue'),
    // 设计策划资料收集
    designPlanCollectDetail: () => import('@/views/design/planning/designPlanDataCollect/update'),
    // 深化设计成果管理
    designOutcomeManagement: () => import('@/views/design/deepDesign/outcomeManagement/detailForm'),
    // 设计资源项目部
    projectEvaluate: () => import('@/views/design/resource/projectEvaluate/details'),
    // 设计资源项目部
    branchEvaluate: () => import('@/views/design/resource/branchEvaluate/details'),
    // 设计资源项目部
    companyEvaluate: () => import('@/views/design/resource/companyEvaluate/details'),
    // 工程预警
    approveLook: () => import('@/views/project/warning/approveLook'),
    // 工程产值记录
    productionRecordsDetails: () => import('../approval/components/ProductionRecords/details'),
    // 工程产值记录
    pointsRecordsDetails: () => import('@/views/project/pointsRecord/details'),
    // 质量创优
    excellenceBudgetDetail: () => import('@/views/quality/excellenceManagement/excellenceBudget/excellenceBudgetEdit'),
    // 计量设备配置计划
    equipmentConfigurationPlanInfo: () => import('@/views/quality/equipmentManagement/equipmentConfigurationPlan/info'),
    //用车申请详情
    carApplicationEdit: () => import('@/views/office/vehicle/carApplication/carApplicationEdit'),
    // 日常物资需用计划
    dailyMaterialRequest: () => import('@/views/materials/plan/dailyMaterialRequest/add'),
    // 日常物资需用计划
    concreteApply: () => import('@/views/materials/plan/concreteApply/add'),
    // 党组织架构
    orgStructure: () => import('@/views/partyMasses/partyBuild/orgStructure/detail'),
    //党建荣耀表详情
    reportparty: () => import('@/views/reportIntegration/details'),
    // 竣工设置
    completionDetails: () => import('../completionDetails'),
    // 逾期节点详情(总计划)
    overdueNodeManagementMasterPlanOperation: () => import('@/views/construction/overdueNodeManagement/components/MasterPlan/detail'),
    // 逾期节点详情(周计划)
    overdueNodeManagementWeekPlanOperation: () => import('@/views/construction/overdueNodeManagement/components/WeekPlan/detail'),
    // 逾期节点详情(合同计划)
    overdueNodeManagementContractPlanOperation: () => import('@/views/construction/overdueNodeManagement/components/contractPlan/detail'),
    // 逾期节点详情(竣工计划)
    overdueNodeManagementCompletionPlanOperation: () => import('@/views/construction/overdueNodeManagement/components/completionPlan/detail'),
    // 逾期节点详情(月计划)
    overdueNodeManagementMonthPlanOperation: () => import('@/views/construction/overdueNodeManagement/components/monthPlan/detail'),
    // 周计划详情
    // 周计划详情
    weekPlanView: () => import('@/views/construction/weekPlan/weekPlanView'),
    // 周计划节点完成详情
    nodeCompletionView: () => import('@/views/construction/weekPlan/components/NodeCompletionView'),
    // 通用第三方详情
    GeneralThirdDetail: () => import('./GeneralThirdDetail'),
    // 停工/停缓建
    stopConstructionDetails: () => import('@/views/project/stopConstruction/details'),
    // 分包商进出场台账详情
    subcontractorsDetails: () => import('@/views/subcontractors/details'),
    // 资料管理计划详情
    dataManagePlanDetails: () => import('@/views/technical/dataManage/dataManagePlan/edit.vue'),
    // 商务成本计划管理
    costPlanApprovalDetail: () => import('@/views/businessAffairs/businessCostPlanManagement/costPlanManagement/costPlan/components/InformationInit'),
    // 商务成本计划调整
    updateInformation: () => import('@/views/businessAffairs/businessCostPlanManagement/costPlanManagement/costPlan/components/InformationAdjustment/updateInformation')
  },
  props: {
    // 征询意见参数
    consultationProps: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      otherData: {},
      props: {}, // 组件props
      curComponent: '',
      businessId: '',
      title: '业务详情',
      businessTypeMap: {
        101: 'createProjectDetail',
        102: 'constructionScheduleView',
        103: 'planDetailMonth',
        104: 'planDetailWeek',
        128: 'NodeStartPage',
        105: 'NodeMaintainPage',
        106: 'constructionScheduleAdjustView',
        111: 'stopConstructionDetails',
        112: 'stopConstructionDetails',
        113: 'stopConstructionDetails',
        114: 'stopConstructionDetails',
        123: 'pointsRecordsDetails',
        119: 'projectDynamicInformationDetail',
        120: 'approveLook',
        121: 'approveLook',
        122: 'productionRecordsDetails',
        124: 'constructionCompletedView',
        125: 'constructionCompletedNodeMaintainPage',
        127: 'addPlannedOutputValue',
        129: 'completionDetails',
        131: 'overdueNodeManagementMasterPlanOperation',
        134: 'weekPlanView',
        135: 'nodeCompletionView',
        136: 'overdueNodeManagementWeekPlanOperation',
        137: 'suppliesMonthPlan',
        138: 'contractorView',
        139: 'constructionMonthPlanView',
        140: 'constructionMonthPlanNodeMaintainPage',
        141: 'monthPlanAdjustView',
        142: 'overdueNodeManagementMonthPlanOperation',
        143: 'overdueNodeManagementContractPlanOperation',
        144: 'overdueNodeManagementCompletionPlanOperation',
        130: 'projectManagerMonthlyReportView',
        132: 'subcontractorsDetails',
        133: 'subcontractorsDetails',
        201: 'procurementPlanAdd',
        202: 'acceptanceDeviceAdd',
        203: 'materialMasterPlanAdd',
        204: 'equipmentPurchasePlanAdd',
        205: 'materialMonthPlan',
        206: 'procurementApplyAdd',
        207: 'procurementReviewAdd',
        208: 'procurementSignAdd',
        220: 'inventoryCheckAdd',
        20901: 'contractReviewAdd',
        20902: 'contractParameterDetail',
        2001: 'updateBranchPerformanceAnalysis',
        211: 'acceptanceDosageAdd',
        212: 'contractClarificaitonAdd',
        213: 'supplierInspectionAdd',

        214: 'remainingDisposalAdd', //mm_assets_apply
        215: 'remainingSettlementAdd', //mm_sur_apply
        216: 'assetsTransfersAdd', //mm_surplus_settle
        217: 'remainingTransfersAdd', //mm_allocation
        218: 'assetsDisposalAdd', //mm_surplus_transfer
        219: 'settlementConcreteAdd', //mm_settlement
        224: () => import('@/views/materials/procurement/tender/add'),
        225: 'dailyMaterialRequest',
        226: 'concreteApply',

        227: () => import('@/views/materials/benefitAnalysis/fieldCostAnalysis/add'),
        228: () => import('@/views/materials/benefitAnalysis/controlIndicators/add'),
        229: () => import('@/views/materials/inventory/checkPlan/add'),
        230: () => import('@/views/materials/procurement/review/add'),
        231: () => import('@/views/materials/procurement/sign/add'),
        232: () => import('@/views/materials/inventory/sceneConsumeMaterialDetail/add'),

        301: () => import('@/views/science/achievementsManage/details'),
        302: () => import('@/views/science/achievementsManage/details'),
        305: () => import('@/views/science/achievementsExtend/technologyApplication/detail'),
        306: () => import('@/views/science/quantitativeManage/quantitative/edit'),
        402: () => import('@/views/quality/highlight/highlightManage/highlightManageEdit'),

        412: () => import('@/views/quality/programme/programmeEdit'), // 质量- 实测实量方案管理
        413: () => import('@/views/quality/programme/programmeEdit'), // 质量-样板引路实施方案管理
        414: () => import('@/views/quality/programme/programmeEdit'), // 质量-编制品质工程六项专项治理
        419: () => import('@/views/quality/riskIdentification/monitoringPlan/info'), // 质量- 重点监管质量风险监控计划
        420: () => import('@/views/quality/riskIdentification/riskTracking/info'), // 质量- 质量风险跟踪
        // 质量创优预算
        418: 'excellenceBudgetDetail',
        421: 'equipmentConfigurationPlanInfo', //计量设备配置计划
        422: () => import('@/views/quality/riskAssessmentProject/summary'), // 质量- 项目质量风险评价汇总
        //子类
        2191: 'settlementConcreteAdd', //mm_settlement
        2192: 'settlementLeaseAdd', //mm_settlement
        2193: 'settlementMaterialsAdd', //mm_settlement

        223: 'benefitAnalysisAdd',

        507: 'projectSettlementAdd',
        536: 'projectSettlementAdd',
        505: 'projectTotalAdd',
        535: 'projectTotalAdd',
        504: 'projectTotalApprovalAdd',
        537: 'projectTotalApprovalAdd',
        501: 'subcontractingBudget',
        506: 'lumpSumBudget',
        508: 'planBook',
        503: 'smlDetail',
        502: 'smlDetail',
        512: 'updatePersonalRiskRefund',
        513: 'updatePersonalRiskToTurn',
        514: 'updateProjectRiskRefund',
        515: 'updateRevenueCostInput',
        516: 'updateAdjustIncomeCost',
        517: 'updateCostReduction',
        520: 'updatePriceSeparation',
        519: 'updateCostAnalysisAudit',
        518: 'updateSubcontractCostPrice',
        521: 'updateTargetBook',
        522: 'updateRealProduct',
        525: 'updateSettlementSubmit',
        526: 'updateSettlementFinalized',
        527: 'updateDesignChange',
        528: 'updateVisaConfirm',
        529: 'updateVisaApproval',
        524: 'finalApproval',
        543: 'finalApproval',
        546: 'postReportingDetailed',
        547: 'costPlanApprovalDetail',
        548: 'updateInformation',
        534: 'workMasterPlanAed',
        538: 'throwMarkDetailed',
        539: 'updatePriceSeparation',
        540: 'businessPlan',
        541: 'designPlanning',
        542: 'costPlanning',
        545: () => import('@/views/businessAffairs/assessmentFulfillment/discharge/edit'),
        530: 'updateTotalPriceApproval',
        533: () => import('@/views/businessAffairs/subcontractMeasurement/addListContract/updateAddListContract.vue'),
        816: () => import('@/views/technical/dataManage/dailyDataManag/updateDailyDataManag.vue'),
        609: () => import('@/views/design/analyse/analyseReport/edit.vue'),
        612: 'designOutcomeManagement',
        620: () => import('@/views/design/designNeed/designIssueReporting/designIssueReportingAed'),
        803: 'standingBook',
        701: 'UpdateProjectControl',
        705: 'inMeeting',
        807: 'newPlan',
        801: 'optimizationPlan',
        802: 'steelTendon',
        704: 'UpdateSystem',
        702: 'UpdateRecord',
        703: 'UpdateWorkItem',
        706: 'addHazardousOperation',
        708: 'addHazardousOperation',
        709: 'addHazardousOperation',
        710: 'addHazardousOperation',
        711: () => import('@/views/safetySupervision/hazardIdentification/hazardIdentificationList/addConference.vue'),
        712: () => import('@/views/safetySupervision/hazardIdentification/riskProjectControl/add.vue'),
        713: () => import('@/views/safetySupervision/safeProductAwardPunish/fineForBreachOfContract/add.vue'),

        825: 'Approval', // 825 施组方案会签
        804: 'Approval', // 804 施组组织设计
        808: 'Approval', // 808 施组方案A类
        809: 'Approval', // 809 施组方案A类二次报审
        810: 'Approval', // 810 施组方案B
        811: 'Approval', // 811 施组方案CD
        812: 'Approval', // 812 施组方案施组
        // 813: 'Approval', // 813 施组方案方案审核师
        813: 'dataManagePlanDetails',
        // 827: 'Approval', // 827 施组方案推优
        814: 'updateMonthlyPlan',
        815: 'updateYearlyPlan',
        817: 'updateDrawingManagement',
        821: 'updatePlanHighlights',
        828: 'updatePlanHighlights',
        819: 'updateDrawingAndNegotiation',
        820: 'updateDrawingAndNegotiation',
        823: 'updateServiceDemand',
        221: 'checkRectificationAdd',
        822: 'updateBaseStandard',
        824: 'updateProjectStandard',
        829: () => import('@/views/project/implementation/addImplement'),
        830: () => import('@/views/project/implementation/addImplement'),
        1001: 'planDiscussionDetails',
        1002: 'planCompleteDetails',
        1003: 'caseManagementCaseDetails',
        1004: 'lawyerLetterDetails',
        1005: 'claimEstablishmentDetails',
        1006: 'claimEstablishmentDetails',

        1124: 'branchContractDetails',
        1125: () => import('@/views/Legal/branchContract/management/details.vue'),
        1126: () => import('@/views/Legal/branchContract/management/details.vue'),

        1102: 'totalPackageContractDetails',
        1103: 'totalPackageContractDetails',
        1121: 'totalPackageContractDetails',
        1122: 'totalPackageContractDetails',
        1106: 'totalPackageContractDetails',
        1107: 'totalPackageContractDetails',
        1108: 'totalPackageContractDetails',
        1111: 'totalPackageContractDetails',
        1117: 'totalPackageContractDetails',
        1118: 'totalPackageContractDetails',
        1119: 'totalPackageContractDetails',
        1120: 'totalPackageContractDetails',
        1123: 'totalPackageContractDetails',

        1112: 'otherTypeContractDetails',
        1113: 'otherTypeContractDetails',
        1114: 'riskListDetail',
        1115: 'riskListDetail',
        1116: () => import('@/views/Legal/risk/list/detail.vue'),

        901: 'superviseDetail',
        902: 'superviseDetail',
        904: 'archivesBorrowingDetail',
        20001: 'updateOrganizationalStructure',
        20002: 'staffRationalizationSuggestionsDetail',
        20003: 'corporateAffairsOpenDetail',
        20004: 'workerProtectionDetail',

        20005: 'difficultiesEmployeesApplyDetail',

        21001: 'supervisorReportDetail',
        21002: 'integrityCultureConstructionDetail',
        21003: 'updateProjectSupervision',
        22001: 'delayArchiveApplyDetail',
        22002: 'ArchiveDocDetail',
        23001: 'carApplicationEdit',
        23002: () => import('@/views/office/vehicle/carMaintenance/carMaintenanceEdit'),
        23010: 'complaintAdd',
        25002: 'standingAdd',
        25003: 'standingAdd',

        906: 'assetManagementTransferAdd',
        905: 'updateApplyEat',

        24001: 'orgStructure',
        24002: 'partyMemberChangeDtl',
        24003: 'partyActivityDetail',
        24004: 'leagueManageChangeDtl',
        1007: 'letterFeedbackDetail',
        1008: 'caseFeedbackDetail',
        610: 'trainingConferenceDetail',
        611: 'planningManagementDetail',
        613: 'designPlanCollectDetail',
        614: 'projectEvaluate',
        615: 'branchEvaluate',
        616: 'companyEvaluate',
        617: 'updateWorkReport',
        608: 'monthlyReport',
        818: 'updatedesignChanges',
        31001: 'plannTableSummaryView',
        32001: 'reportparty', //1/14新增
        34001: 'GeneralThirdDetail',
        34002: 'GeneralThirdDetail',
        34003: 'GeneralThirdDetail',
        34004: 'GeneralThirdDetail',
        34005: 'GeneralThirdDetail'
      },
      businessTypeTitleMap: {
        101: '项目立项详情',
        102: '施工进度总计划详情',
        103: '施工进度月计划详情',
        104: '施工进度周计划详情',
        128: '节点开始详情',
        105: '节点完成详情',
        106: '施工进度总计划调整详情',
        123: '项目经理风险底线管理详情',
        119: '项目动态信息详情',
        120: '  ',
        121: '  ',
        122: '  ',
        124: '竣工收尾计划详情',
        125: '竣工收尾计划节点维护详情',
        127: '年度计划产值详情',
        130: '项目经理月报详情',
        131: '逾期节点管理详情',
        134: '周计划详情',
        135: '周计划节点完成详情',
        136: '周计划逾期节点管理详情',
        138: '合同计划详情',
        139: '月计划审批详情',
        140: '月计划节点维护审批详情',
        141: '月计划调整审批详情',
        142: '逾期节点管理月计划详情',
        143: '逾期节点管理合同计划详情',
        144: '逾期节点管理竣工收尾计划详情',
        132: '分包商进出场台账详情',
        133: '分包商进出场台账详情',
        201: '物资招标计划详情',
        202: '机械设备进场验收详情',
        203: '物资需求总计划详情',
        204: '物资设备采购策划详情',
        205: '物资需求月计划详情',
        206: '物资招标采购申请详情',
        207: '物资招标文件评审详情',
        208: '物资招标评审会签详情',
        220: '物资盘点记录详情',
        20901: '物资合同评审详情',
        20902: '物资合同台账详情',
        210: '物资合同用印申请详情',
        211: '物资用量确认单详情',
        212: '合同交底记录详情',
        213: '供应商考察详情',
        223: '采购效益分析详情',
        224: '物资招标定标详情',
        225: '日常物资需用计划详情',
        226: '混凝土申请表详情',

        214: '剩余物资处置申请详情', //mm_assets_apply
        215: '剩余物资结算申请详情', //mm_sur_apply
        216: '资产调拨单详情', //mm_surplus_settle
        217: '资产调拨单详情', //mm_allocation
        218: '资产处置申请详情', //mm_surplus_transfer
        219: '混凝土结算详情', //mm_settlement
        //子类
        2191: '混凝土结算详情', //mm_settlement
        2192: '租赁费结算单详情', //mm_settlement
        2193: '物资结算详情', //mm_settlement

        221: '整改回复详情',
        227: '现场成本节超分析表详情',
        228: '管控指标详情',
        229: '物资盘点计划详情',
        230: '物资招标文件评审详情',
        231: '物资招标文件评审会签详情',
        232: '现场消耗物资明细表详情',

        301: '科技成果详情',
        302: '科技成果详情',
        305: '新技术应用情况详情',
        306: '科技量化责任书信息',
        402: '质量亮点上报详情',

        412: '实测实量方案管理',
        413: '样板引路实施方案管理',
        414: '编制品质工程六项专项治理',
        418: '质量创优预算',
        419: '重点监管质量风险监控计划详情',
        420: '质量风险跟踪详情',
        421: '计量设备配置计划',
        422: '项目质量风险评价汇总',
        507: '结算责任书审批详情',
        505: '总包结算策划详情',
        504: '提交竣工结算文件审批详情',
        501: '分包施工图预算审批详情',
        506: '总包施工图预算审批详情',
        508: '项目商务策划书详情',
        503: '分包计量审批详情',
        502: '分包计量审批详情',
        512: '个人预留风险金返还申请详情',
        513: '个人预留风险金抵转申请详情',
        514: '项目风险金返还详情',
        515: '总收入总成本录入详情',
        516: '总收入总成本调整详情',
        517: '项目成本还原、总结详情',
        520: '标价分离书详情',
        519: '成本分析表详情',
        518: '分包人成本指导价详情',
        521: '目标责任书详情',
        522: '业主确权及实际产值详情',
        525: '期中结算报送审批详情',
        526: '期中结算定案审批详情',
        527: '设计变更管理详情',
        528: '总包确认归档审批详情',
        529: '总包签证报送审批详情',
        524: '总包结算定案审批详情',
        530: '分包预算转总价审批详情',
        533: '新增清单或超额合同审批详情',
        609: '设计管理复盘报告详情',
        620: '设计问题上报',
        612: '深化设计成果管理',

        1001: '分包招议标计划详情',
        1002: '分包招议标计划完成情况详情',
        1003: '执行案件详情信息',
        1004: '律师函管理详情',
        1005: '索赔立项详情',
        1006: '索赔立项详情',

        1124: '分包合同信息详情',
        1125: '分包合同信息详情',
        1126: '分包合同信息详情',

        1102: '总包合同信息详情',
        1103: '总包合同信息详情',
        1121: '总包合同信息详情',
        1122: '总包合同信息详情',
        1106: '总包合同信息详情',
        1107: '总包合同信息详情',
        1108: '总包合同信息详情',
        1111: '总包合同信息详情',

        1112: '其他合同信息详情',
        1113: '其他合同信息详情',
        1114: '风险管理信息详情',
        1115: '风险管理信息详情',
        1116: '风险管理信息详情',
        1119: '风险复核详情',

        901: '督办反馈信息详情',
        902: '承办延长申请详情',
        904: '档案借阅详情',
        2001: '分公司工程履约管理详情',
        20005: '困难职工申请详情',
        20002: '职工合理化建议详情',
        20003: '企务公开详情',
        20004: '职工维权上报详情',

        21001: '监督员上报详情',
        21003: '监督月报详情',
        24001: '党组织架构详情',
        905: '临时用餐申请详情',
        21002: '文化建设活动详情',

        22001: '延期归档申请详情',
        22002: '竣工项目归档详情',
        20001: '工会组织详情',

        23001: '用车申请详情',
        23002: '车辆维保详情',
        23010: '投诉管理详情',
        25002: '维保事项台账详情',
        25003: '维保事项台账详情',
        906: '资产调拨详情',
        24003: '党群活动详情',
        1007: '函件反馈详情',
        1008: '执行案件反馈详情',
        610: '设计培训管理会详情',
        611: '深化设计策划书',
        613: '设计策划资料收集详情',
        614: '项目部评价详情',
        615: '分公司评价详情',
        616: '公司评价详情',
        711: '危险源辨识会议及清单详情',
        712: '风险项目分级管控详情',
        713: '违约罚款台账详情',

        804: '施组(方案)审批详细',
        825: '施组(方案)审批详细',
        814: '月度计划详情',
        815: '年度计划详情',
        817: '设计图纸管理详情',
        816: '日常资料管理',
        821: '经典方案详情',
        608: '设计月报详情',
        818: '设计变更详情',
        819: '图纸会审详情',
        820: '技术洽商详情',
        823: '技术服务需求详情',
        822: '基础规范详情',
        824: '项目规范详情',
        829: '双优化实施销项详情',
        830: '双优化实施推优',
        31001: '工程策划表详情',
        32001: '荣誉详情', //1/14新增
        34001: '企划部年度计划流程',
        34002: '企划部月度计划流程',
        34003: '企划部督查督办流程',
        34004: '分公司年度计划',
        34005: '分公司月度计划',
        813: '资料管理计划',
        547: '成本计划管理',
        548: '成本计划管理调整'
      }
    }
  },
  mounted() {
    this.initKfCode()
    this.initPage()
  },
  computed: {
    // 是否作为意见征询详情显示
    isConsultation() {
      return Object.keys(this.consultationProps || {}).length > 0
    }
  },
  watch: {
    $route: {
      handler: function (val, oldVal) {
        val && this.initPage()
      },
      // 深度观察监听
      deep: true
    }
  },
  methods: {
    initKfCode() {
      getAllBusinessCode().then((res) => {
        res.data.map((item) => {
          let approvalArr = localStorage.getItem('approvalArr') || null
          //不是批量审批，走正常赋值
          if (!approvalArr?.length) {
            this.businessTypeTitleMap[item] = '投诉管理详情'
            this.businessTypeMap[item] = 'complaintAdd'
          }
        })
      })
    },
    async initPage() {
      try {
        let { businessType, businessId, detailUrl } = this.isConsultation ? this.consultationProps : this.$route.query

        console.log(businessType, 'businessType')
        // 没有上面的参数时不进入
        if (!businessType) return
        document.title = this.businessTypeTitleMap[businessType] || '中建八局'
        //如果是结算，调接口查询结算类型，跳对应的页面
        if (businessType === '219') {
          let res = await findListByMainMaterialId({ id: businessId })
          if (res.code === 200) {
            this.$console(res.data.settleType)
            if (res.data.settleType === 'SETTLE_MATERIAL') {
              businessType = 2193
            }
            if (res.data.settleType === 'SETTLE_LEASE') {
              businessType = 2192
            }
            if (res.data.settleType === 'SETTLE_CONCRETE') {
              businessType = 2191
            }
            this.curComponent = this.businessTypeMap[businessType] || ''
          } else {
            this.$message.warning('获取详情失败')
          }
        } else if (businessType === '904') {
          this.props = { detailType: '2' }
          this.curComponent = this.businessTypeMap[businessType] || ''
        } else if (businessType === '1101') {
          let res = await whoIsContract({ id: businessId })
          // this.otherData = { detailsTitleName: '分包合同详情信息' }
          this.otherData = { detailsTitleName: res.data }
          this.curComponent = this.businessTypeMap[businessType] || ''
        } else if (businessType === '209') {
          let res = await findContractMenuById({ id: businessId })
          businessType = '20902'
          if (res.code === this.SUCCESS_CODE) {
            businessType = res.data
          }
          this.curComponent = this.businessTypeMap[businessType] || ''
        } else if (30001 <= businessType * 1 && businessType * 1 <= 30025) {
          this.curComponent = 'projectManagementPlanning'
        }
        // else if (businessType === '813') {
        //   this.curComponent = 'Approval'
        // }
        else if (businessType === '827') {
          //因为施组方案推优和经典案列库的推优type是一样，所以调用经典案列库的详情接口，有值就到经典案列库
          let flag = false
          getPlanHighlights({ id: businessId })
            .then((res) => {
              if (res.code == 200) {
                flag = res.data.planName ? true : false
              } else {
                flag = false
              }
              if (flag) {
                this.curComponent = 'updatePlanHighlights'
              } else {
                this.curComponent = 'Approval'
              }
            })
            .catch(() => {})
        } else {
          this.curComponent = this.businessTypeMap[businessType] || ''
          if (!this.curComponent) {
            const routers = this.flatRouters(this.$clone([...constantRouterMap, ...asyncRouterMap]))
            detailUrl = decodeURIComponent(detailUrl)
            detailUrl.indexOf('?') > -1 && (detailUrl = detailUrl.slice(0, detailUrl.indexOf('?'))) //截取掉detailUrl后面拼接的参数
            let res = routers.find((v) => v.path === detailUrl)
            // 避免递归当前组件，造成溢出
            if (res?.name !== 'AuditBusinessDetail') {
              console.log(res, '期中')
              res?.props &&
                (this.props = {
                  bussinessId: businessId,
                  pathName: decodeURIComponent(detailUrl),
                  ...res.props
                })
              this.curComponent = res?.component || res?.iframeComponent || ''
              this.title = (res.meta && res.meta.title) || '业务详情'
              return
            }
          }
        }
        this.title = this.businessTypeTitleMap[businessType] || '业务详情'
      } catch (error) {
        console.log(error)
      }
    },
    // 扁平化路由
    flatRouters(list) {
      let routers = []

      function getList(e) {
        for (let item of e) {
          routers.push(item)
          if (item.children?.length) {
            getList(item.children)
          }
        }
      }

      getList(list)
      return routers
    }
  }
}
</script>

<style lang="less">
// 区别处理已经征询详情页
.audit-class > div {
  height: auto !important;

  .base-iframe {
    height: 800px;
  }
}

.consultation-class {
  padding: 0;

  .BaseBreadcrumb-container {
    padding: 0 !important;

    > div {
      height: auto !important;
      padding: 0 !important;
    }
  }
}
</style>
<style lang="less" scoped>
/deep/ .breadcrumb-wrapper {
  display: none;
}

/deep/ .tool-btns--fixed {
  display: none;
}
</style>